<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css" />
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css" />
			<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/spectrum.css" />
	</head>

	<body>
		<div class="am-g">
			{include file='../Common/hy_header.html'}
			<div class="am-u-md-8 am-u-end">
				<form class="am-form am-form-horizontal hy-js-form">
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">标题</label>
						<div class="am-u-sm-9">
							<input type="text" name="title" value="{$art['title']}">
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">链接</label>
						<div class="am-u-sm-9">
							<input type="text" name="video_url" value="{$art['video_url']}">
						</div>
					</div> 
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">缩略图</label>
            <div class="am-u-sm-4">
              <input type="text" name="thumb_url" class="am-input-sm thumb" value="{$art.thumb_url}">
            </div>
            <div class="am-u-sm-1">
            	 <img id="hy-thumb"  style="height: 30px;" {if $art.thumb_url}src="{$art.thumb_url}"{else} src="{$_C.hy_path}images/logo2.png" {/if}>
            	</div>
             <div class="am-u-sm-4 am-u-end">
             	<button class="am-btn am-btn-primary am-btn-xs hy-js-uploadimg" >上传</button>
          </div>
					</div>
					
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">头像</label>
            <div class="am-u-sm-4">
              <input type="text" name="avatar" class="am-input-sm avatar" value="{$art.avatar}">
            </div>
            <div class="am-u-sm-1">
            	 <img id="hy-avatar" class="hy-js-cutimg" style="height: 30px;" {if $art.avatar}src="{$art.avatar}"{else} src="{$_C.hy_path}images/logo2.png" {/if}>
            	</div>
             <div class="am-u-sm-4 am-u-end">
             	<button class="am-btn am-btn-primary am-btn-xs hy-js-avatar" >上传</button>
          </div>
					</div>
					
					
					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<input type="hidden" name="id" id="id" value="{$art.id}" />
							<button type="button" class="am-btn am-btn-primary hy-js-submit">保存</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		
		{include file='../Common/hy_footer.html'}
				<script type="text/javascript" src="{$_C.hy_path}js/hy.base.js"></script>
		<script type="text/javascript">
		hy_uploadimg('/ad',{ 'target':'.hy-js-avatar'},function(result,_this){
		    	if(typeof(result[0])!='undefined')
		    	{
		        	_this.parent().parent().find('#hy-avatar').attr('src',result[0].substr(1));
		        	_this.parent().parent().find('input.avatar').val(result[0].substr(1)).focus();
		       }
		    })
			hy_uploadimg('/ad',{ 'target':'.hy-js-uploadimg'},function(result,_this){
		    	if(typeof(result[0])!='undefined')
		    	{
		        	_this.parent().parent().find('#hy-thumb').attr('src',result[0].substr(1));
		        	_this.parent().parent().find('input.thumb').val(result[0].substr(1)).focus();
		       }
		    })
			   hy_submit('index.php?g=admin&m=video&a={$action}');
		</script>
	</body>

</html>